package com.YCH.login.controller.v1;

import com.YCH.apis.login.apis.LoginControllerApi;
import com.YCH.login.service.TbUserLoginService;
import com.YCH.model.common.dtos.ResponseResult;
import com.YCH.model.user.pojos.TbUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/login")
public class LoginController implements LoginControllerApi {

    @Autowired
    private TbUserLoginService TbUserLoginService;

    @PostMapping("/login_auth")
    @Override
    public ResponseResult login(@RequestBody TbUser user) {
        return TbUserLoginService.loginAuth(user);
    }
}